Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Fix FromGlibContainer double freeing #160

Merged
merged 1 commit into from May 3, 2017

Conversation

EPashkin
Copy link
Member

@EPashkin EPashkin commented Apr 29, 2017

Revert one change from #153
Was wrong replacing g_free with g_strfreev by two reason:

  1. g_strfreev frees inner string that already freed
  2. g_strfreev must used only for string arrays, but this implementation for any arrays

@EPashkin
Copy link
Member Author

@Susurrus please check that this don't broke gtk-rs/gtk#469

@sdroege
Copy link
Member

sdroege commented May 2, 2017

Might make sense to add a simple test for this, looks good and correct to me apart from that

@EPashkin
Copy link
Member Author

EPashkin commented May 2, 2017

No idea how to test it :(

@GuillaumeGomez
Copy link
Member

How did you get the bug?

@EPashkin
Copy link
Member Author

EPashkin commented May 2, 2017

See gtk-rs/examples#119 (comment)

@sdroege
Copy link
Member

sdroege commented May 2, 2017

@EPashkin You could manually create such a NULL-terminated array of e.g. strings with glib_sys::g_malloc() and ::g_strdup(). When passing that in there it should crash.

@EPashkin
Copy link
Member Author

EPashkin commented May 2, 2017

@sdroege, Thanks I don't even think to test it (forgot that it not Gtk and can be tested).

@Susurrus
Copy link

Susurrus commented May 3, 2017

gtk-rs/gtk#469 is still fixed with this code, but this doesn't seem to fix gtk-rs/examples#119. I'm getting new errors now, like:

  • (.:12663): Gtk-CRITICAL **: GtkBox 0x7f8893b191a0 returned a widget path for type (null), but child is GtkScrolledWindow
  • (.:12663): Gtk-CRITICAL **: gtk_style_provider_get_style_property: assertion 'g_type_is_a (gtk_widget_path_get_object_type (path), pspec->owner_type)' failed
  • (.:12809): GLib-GObject-WARNING **: g_object_weak_unref: couldn't find weak ref 0x7ff1eb45c5e0(0x7ff1ece22ed8)

But I don't get hard segfaults anymore with no warnings or errors, so I guess that's an improvement.

@EPashkin
Copy link
Member Author

EPashkin commented May 3, 2017

@GuillaumeGomez ready for merge

@GuillaumeGomez
Copy link
Member

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit ad0062a into gtk-rs:master May 3, 2017
@EPashkin EPashkin deleted the from_glib_fix branch May 3, 2017 10:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants